import React, { Component } from 'react';


class Dome extends Component{
  state={

  }
  constructor(props){
    super(props);
    console.log("---Dome组件中的constructor")
  }
  static getDerivedStateFromProps(props,state){
    console.log("---Dome组件的getDerivedstateFromPros")
    return null
  }
  render(){
    console.log("---Dome组件的render方法")
    return <h1>demo组件</h1>
  }
  componentDidMount(){
    console.log("---Dome组件的componentDidMount方法")
  }
}

class App extends Component {
  state ={

  }
  constructor(props){
    super(props);
    console.log("1.组件App组件中的 constructor")
  }
  static getDerivedStateFromProps(props,state){
    console.log("2.执行App组件getDerivedStateFromProps");
    return null;
  }
  render() {
    console.log("3.执行App组件中render函数")
    return (
      <div>
        <Dome></Dome>
      </div>
    );
  }
  componentDidMount(){
    console.log("4.执行App组件componentDidMount方法")
  }
}

export default App;
